import React, { Component } from 'react';
import {
    View,
    Text,
    Alert,
    StyleSheet,
    TouchableOpacity,
} from 'react-native';
import Entypo from 'react-native-vector-icons/Feather';
import MorePopWidows from './MorePopWidows';
export default class HomeTab extends Component{

    constructor(props) {
        super(props);
        this.state = {
            showPop: false,
        }

    }

    change = ()=>{
        // Alert.alert('sad')
        this.setState({ showPop: true })
    }

    render() {
        //解构
        
        return (
            <View style={{ flex: 1 }}>
                <View>
                    <TouchableOpacity
                        style={styles.btn}
                        onPress={this.change.bind(this)}>

                        <Entypo name='plus' size={30} color="#10B1F6" style={{ alignItems: 'center', marginRight: 15, }}></Entypo>
                    </TouchableOpacity>
                </View>
                
                <View style={{ position: 'absolute',}}>
                    <MorePopWidows width={90} height={100} show={this.state.showPop} closeModal={(show) => {
                            this.setState({ showPop: show })
                        }}
                        groupChat = {this.props.groupChat}
                        addFrienf = {()=>{
                            this.setState({ showPop: false })
                            navi('addFriendScene')
                        }}
                        QRCode = {this.props.QRCode}
                        payOff={this.props.payOff}
                    /> 

                </View>
                
            </View>
					
        );
    }
}

const styles = StyleSheet.create({

    btn: {
        // flex: 1,
        alignItems: 'center',
        borderRadius: 10,
        // backgroundColor: '#0074D9',
        justifyContent: 'center',
    },
    text: {
        fontSize: 18,
        color: '#fff',

    },

});